/*****
 * 
 * 上传共用Controller，该对象使用了Spring MVC自带的上传方法进行数据处理
 * A total of three file upload methods are available
 * A FileOutputStream
 * B CommonsMultipartFile 
 * C CommonsMultipartResolver
 * 
 * It is recommended to use method 2 and method 3
 * 
 * <!--Example-->
 * <form name="serForm" action="/SpringMVC/fileUpload" method="post"  enctype="multipart/form-data"> 
 * <input type="file" name="file">
 * <input type="submit" value="upload"/>
 * </form>
 * 
 * <!-- 多部分文件上传 配置-->
 * <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
 *   <property name="maxUploadSize" value="104857600" />
 *   <property name="maxInMemorySize" value="4096" />
 *   <property name="defaultEncoding" value="UTF-8"></property>
 * </bean>
 * 
 * @author ghj 
 */
package com.smforj.ssm.sys.web.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.multipart.commons.CommonsMultipartFile;

import com.smforj.ssm.frame.core.web.domain.DataResult;

/***
 * 共用接口
 * 
 * @author Haijun Gao 
 * @date 2016-9-8 上午10:22:39
 * @desp http://www.cnblogs.com/saga5998/
 * @email 573107773@qq.com
 */ 
public interface UploadController{  
	
	/***
	 * 通过流方式上传文件
	 * @param file
	 * @return
	 * @throws IOException
	 * @date 2017-5-23 下午4:11:15
	 */
	public DataResult<String>  fileUploadStream(CommonsMultipartFile file) throws IOException;
	/***
	 * 通过file.Transto 方式进行上传,该方法同样适用于c# Client上传
	 * @param file
	 * @return 
	 * @throws IOException
	 * @date 2017-5-23 下午4:12:02
	 */
	public DataResult<String>  fileUploadTransto (CommonsMultipartFile file) throws IOException;
	
	/***
	 * 采用Spring方式进行文件上传
	 * @param request
	 * @return
	 * @throws IllegalStateException
	 * @throws IOException
	 * @date 2017-5-23 下午4:13:10
	 */
	public DataResult<String>  fileUploadSpring (HttpServletRequest request) throws IllegalStateException, IOException;
 }
